package com.sam.designpattern.mediator.source;

/**
 * @Author: Sam
 * @Date: 2022-08-02 11:24
 * @Description: 具体的中介者实现
 */
public class ConcreteMediator implements Mediator {

    /**
     * 持有并维护同事A
     */
    public ConcreteColleagueA colleagueA;

    /**
     * 持有并维护同事B
     */
    public ConcreteColleagueB colleagueB;

    @Override
    public void changed(Colleague colleague) {
        //某个同事类发生了变化，通常需要与其他同事交互
        //具体协调相应的同事对象来实现协作行为
    }

    public void setColleagueA(ConcreteColleagueA colleagueA) {
        this.colleagueA = colleagueA;
    }

    public void setColleagueB(ConcreteColleagueB colleagueB) {
        this.colleagueB = colleagueB;
    }
}
